var mm = require('util/mm.js');
require('./index.css');
var module = require('../module.js');
var navi = require("../common/globalNavi/index.js");

$(function(){
	//banner
	var bannerTpl=require('./banner.tpl');
	var bannerHtml=bannerTpl();
	$('.banner').html(bannerHtml);

	$('.banner').unslider({
		speed: 500,
		delay: 5000,
		//arrows: true,
		fluid: true,
		dots: true
	});
	//navi 
	navi.setHtml({
		name: "home"
	});
});
// -------------
var template = require("./test.tpl");
var html=template({
	name:"1111jin",
	arr:['one','two']
}) 
$('#box').html(html);
//-------------



require('util/unslider/index.js');

var pp = {
	url: "/product/list.do",
	type: "GET",
	data: {
		keyword: 2
	}
}


mm.request(pp).done(function(res) {
	console.log(JSON.stringify(res));
}).fail(function() {
	console.log('error');
});

console.log(mm.getUrlParam('age'));

var html = '<div>{{data.age}}</div>';
var data = {
	data: {
		name: "jin",
		age: 29
	}
};
console.log(mm.renderHtml(html, data));